<?php

namespace apiend\modules\inventory\controllers;

use Yii;
use apiend\components\Controller;
use apiend\modules\inventory\models\BatchForm;

/**
 * 获取业务类型相关接口
 * 
 * @author emhome <emhome@163.com>
 * @since 1.0
 */
class CreateController extends Controller {

    /**
     * @inheritdoc
     */
    protected function verbs() {
        return [
            '*' => ['POST'],
        ];
    }

    /**
     * 首页默认接口
     * @inheritdoc
     */
    public function actionIndex() {
        $model = new BatchForm();
        $model->user_id = $this->uid;
        if (!$model->load(Yii::$app->request->post(), '')) {
            parent::warning('提交的数据未加载成功');
        }
        return $model->save();
    }

}
